#include <stdio.h>
 
int list[100] = {0};
int cnt = 0;
 
void printList()
{
    for ( int i = 0; i < cnt; i++ ) {
        printf("%3d", list[i]);
    }
    printf("\n");
}
 
void getCombine(int n, int k)
{
    if ( k == 0) {
        printList();
        return;
    }
    for (int  i = n; i >= 1; i--) {
        list[cnt++] = i;
        getCombine(i-1, k-1);
        cnt --;
    }
}
 
int main()
{
    int n = 0, k = 0;
    scanf("%d %d", &n, &k);
    getCombine(n, k);
    return 0;
}
